package com.fh.Enum;

/**
 * Created by tugou on 2017/9/24.
 */
public enum EnException {
    OFF(0,"关闭"),
    ON(1,"开启");

    private Integer index;
    private String name;

    EnException(Integer index,String name){
        this.index = index;
        this.name = name;
    }

    public static String getName(Integer index){
        for (EnException e : EnException.values()) {
            if(e.index == index){
                return e.name;
            }
        }
        return null;
    }
}
